package com.linq.cool.gateway.service;

import com.linq.cool.common.core.domain.Result;
import com.linq.cool.common.core.exception.ValidateCodeException;

import java.io.IOException;

/**
 * @Author: yqlin
 * @Date: 2021/1/21 04:01
 * @Description: 验证码处理
 * @Version: 1.0.0
 */
public interface ValidateCodeService {
    /**
     * 生成验证码
     *
     * @return 结果
     *
     * @throws IOException
     * @throws ValidateCodeException
     */
    Result<?> createCaptcha() throws IOException, ValidateCodeException;

    /**
     * 校验验证码
     *
     * @param code 验证码结果
     * @param uuid 验证码唯一标识
     *
     * @throws ValidateCodeException
     */
    void checkCaptcha(String code, String uuid) throws ValidateCodeException;
}
